<?php include('_init_.php'); ?>
<?php 
$GLOBALS['PAGE_ADDED_URL'] = 'working-edit.php';
if ( isset($_REQUEST['cat_id']) ) {
	$GLOBALS['PAGE_ADDED_URL'] .= '?cat_id='.$_REQUEST['cat_id'];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../css/admin-body.css" rel="stylesheet" type="text/css" />
<link href="../css/admin-working.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
<title>班尼頓寫真後台管理</title>
</head>

<body>
<?php include_once('admin-top.php');?>
<div id="main" class="clearfix"><!-- star #main //-->
  <?php include_once('sub-working.php');?>
  <div id="contactall"><!-- star #main //-->
  <div id="tit" ><!-- star #tit //-->
    <ul>
    <li class="tit-a">作品分享</li>
    <li class="tit-b"><a href="<?php echo $GLOBALS['PAGE_ADDED_URL'];?>">新增作品</a></li>
    </ul>
  </div><!-- end #tit //-->
  <div id="contact" class="clearfix" ><!-- star #contact //-->
  <?php foreach($GLOBALS['PAGE_LIST_DATA'] as $row):?>
  <ul>
    <li >	
     <?php if ($row['img_path']):?>
    <img  id="img_image" width="300" height="200" src="../img/<?php echo $GLOBALS['GV_IMAGE_PATH'].$row['img_path'];?>"/>
    <?php else:?>
     <img src="../img/working-none.png" id="img_image" width="300" height="200"/>
    <?php endif;?>
    </li>
    <li>相簿名稱：<?php echo $row['title'];?></li>
    <li>建立日期：<?php echo $GLOBALS['APP_INSTANCE']->formatDate($row['date'],'Y/m/d');?></li>
    <li>觀看次數：<?php echo $row['visit_times'];?></li>
    <li class="con-1">網址：<a href="<?php echo constant('SITE_URL_PATH').'/working.php?id='.$row['id'];?>" target="_blank"><?php echo constant('SITE_URL_PATH').'/working.php?id='.$row['id'];?> </a></li>
    <li class="con-2"><a href="working-edit.php?act=edit&id=<?php echo $row['id'];?>"> 管理相簿</a> <a href="working-photo.php?working_id=<?php echo $row['id'];?>">修改相片</a> <a href="working.php?act=set_delete&id=<?php echo $row['id'];?>">關閉 </a> <a href="working.php?act=delete&id=<?php echo $row['id'];?>" onclick="return confirm('確定刪除?');">刪除 </a></li>
    </ul>
  <?php endforeach;?>
  
  
  </div><!-- end #contact //-->
  <div id="page">
  <ul>
   <?php if ( $GLOBALS['PAGE_LIST_PAGE'] < $GLOBALS['PAGE_LIST_TOTAL_PAGE']):?>
    <li><a href="#" onclick="return next_page();">以前の &gt;</a> </li>
     <?php endif;?>
     
    <?php if ( $GLOBALS['PAGE_LIST_PAGE'] > 1):?>
    <li> <a href="#" onclick="return prev_page();"> &lt;次の </a> </li>
     <?php endif;?>
  </ul>
</div>
  </div><!-- end #contactall //-->
</div><!-- end #main //-->
<script type="text/javascript">
function next_page()
{
	var form = document.forms['form_filter'];
	form.page.value = parseInt(form.page.value,10) + 1;
	form.submit();
	return false;
}
function prev_page()
{
	var form = document.forms['form_filter'];
	form.page.value =  parseInt(form.page.value,10) - 1;
	form.submit();
	return false;
}
function set_filter_key_word(key_word)
{
	var form = document.forms['form_filter'];
	form.key_word.value =  key_word;
	form.submit();
	return false;
}
</script>
<form method="get" name="form_filter" action="<?php echo $_SERVER['PHP_SELF']?>">
<input type="hidden" name="page" value="<?php echo $_REQUEST['page'];?>"/>
<input type="hidden" name="key_word" value="<?php echo isset($_REQUEST['key_word'])?$_REQUEST['key_word']:'';?>"/>
<input type="hidden" name="cat_id" value="<?php echo isset($_REQUEST['cat_id']) && $_REQUEST['cat_id'] > 0?$_REQUEST['cat_id']:'';?>"/>
</form>
</body>
</html>